import { defineStore } from 'pinia'
import { ref } from 'vue'
import type { SignVo } from '@/api/base/types'
export const useSignsStore = defineStore('signs_store',
  () => {
    const signs = ref<SignVo[]>()
    /**
     *设置标志数据
     * @param val
     */
    const setSigns = (val: SignVo[]) => {
      signs.value = val
    }
    /**
     * 清除标志数据
     */
    const clearSigns = () => {
      signs.value = []
    }
    return {
      signs,
      setSigns,
      clearSigns,
    }
  },
  {
    persist: {
      storage: {
        getItem(key) {
          return uni.getStorageSync(key)
        },
        setItem(key, value) {
          uni.setStorageSync(key, value)
        },
      },
    },
  },
)
